/**
 * 
 */
package com.ideeli.hwz.context;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.ideeli.webextractor.utils.Utility;

/**
 * @author sa
 *
 */
public class HWZcontext
{
	private static final Logger logger = Logger.getLogger(HWZcontext.class);
	
	private HWZcontext(){}
	
	
	private static class ApplicationContextHolder{
		public static final ApplicationContext applicationContext= new ClassPathXmlApplicationContext(new String[] {"hwz.xml"});
	}
	
	
	public static ApplicationContext getApplicationContext()
	{
		System.out.println("configuring log4j.");
		Utility.initlog4j();
		logger.info("get singleton ApplicationContext in HWZcontext");
		return ApplicationContextHolder.applicationContext;
	}

}
